import React from "react";

export const Moduel =({children}: any) => {
    //接受子组件，遍历，返回
    return React.Children.map(children,(child) => {
        console.log('child',child.type);
        console.log('children',children);

        if(child.type.displayName == 'Moduel.ModuelOne' )return React.cloneElement(child);
    })
  };
const ModuelOne=({children}: any) => {
    return children;
};
const ModuelTwo=({children}: any) => {
    return children;
};
Moduel.ModuelOne = ModuelOne;
(Moduel.ModuelOne as any).displayName = 'Moduel.ModuelOne';

Moduel.ModuelTwo = ModuelTwo;
(Moduel.ModuelTwo as any).displayName = 'Moduel.ModuelTwo ';

